<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>请先登录</title>


	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <body>
	<div class="login">
		<div class="login-screen">
			<div class="app-title">
				<h1>Login</h1>
			</div>

			<div class="login-form">
				<div class="control-group">
				<input type="text" class="login-field" value="" placeholder="username" id="login-name">
				<label class="login-field-icon fui-user" for="login-name"></label>
				</div>

				<div class="control-group">
				<input type="password" class="login-field" value="" placeholder="password" id="login-pass">
				<label class="login-field-icon fui-lock" for="login-pass"></label>
				</div>

				<a class="btn btn-primary btn-large btn-block" onclick="login()">login</a>
				<!--<a class="login-link" href="#">Lost your password?</a>-->
			</div>
		</div>
	</div>


  <script>
 function login() {
	  var uname = $("#login-name").val();
	  var pwd = $("#login-pass").val();
	  if(uname.trim()=="" || pwd.trim()==""){
	      alert("不要遗漏用户名或者密码！");
		  return;
	  }
	 $.post(
		   '/admin/login',
	 {
	     uname:uname,
		 pwd:pwd
	 },
		 function (data) {
			 if(data=="ojbk"){
			     window.location.href="/admin/";
			 }else{
			     alert("账号或者密码错误！！！")
			 }
         }

	 )
 }
  </script>
</body>
  
  

</body>

</html>
